package com.adcc.loadsheet.billing.mapper.mysql.contractuser;

import com.adcc.loadsheet.billing.entity.contractuser.ContractUserStaffEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 合同用户和用户关联表（关联用户）Mapper
 * Created by zhaoml on 2020-04-15.
 */
@Mapper
public interface ContractUserStaffEntityMapper {

    //根据合同用户删除
    int deleteByContractUserId(Integer contractUserId);

    //批量新建合同用户-用户关联关系
    void insertByBatch(@Param("contractUserId") Integer contractUserId, @Param("loginIds") String loginIds);

    //查询与合同用户绑定的关联用户
    List<String> selectLoginIds(Integer contractUserId);

    //查询与用户绑定的其他合同用户
    List<Integer> selectOtherContractUserIds(@Param("loginId")String loginId,@Param("contractUserId")Integer contractUserId);

    //根据登录名查询（查询是否是合同用户）
    List<ContractUserStaffEntity> selectByLoginId(String loginId);
}